import { DataSource } from 'typeorm';
import { PostsEntity } from './modules/posts/posts.entity';

export const AppDataSource = new DataSource({
  type: 'mysql',
  host: configService.get('DB_HOST', '127.0.0.0'),
  port: configService.get<number>('DB_PORT', 3306),
  username: configService.get('DB_USER', 'root'),
  password: configService.get('DB_PASSWORD', 'root'),
  database: configService.get('DB_DATABASE', 'blog'),
  // charset: 'utf8mb4',
  timezone: '+08:00',
  synchronize: true,
  autoLoadEntities: true,
});
